﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Utils;

namespace Cofe.Core
{
    public enum ServiceImportOptions { ImportAll, ImportFirst }
    public class CofeServiceImportOptionAttribute : Attribute
    {
        public ServiceImportOptions ServiceImportOptions { get; private set; }
        public CofeServiceImportOptionAttribute(ServiceImportOptions importOption)
        {
            ServiceImportOptions = importOption;
        }

        public static ServiceImportOptions GetImportOptions(Type type)
        {
            var attrib = AttributeUtils<CofeServiceImportOptionAttribute>.FindAttribute(type);
            if (attrib == null)
                return ServiceImportOptions.ImportAll;
            else return attrib.ServiceImportOptions;
        }

    }
}
